package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Mapper
public interface UserMapper {

    //用户登录
    User selUserByOpenid();

    //新增用户
    void addUser(User user);

    //查询用户信息
    @Select("select * from user where id = #{id};")
    User selUserById(Long id);

    //用户统计接口
    @Select("select count(*) from user where create_time between #{begin} and #{end};")
    Long userStatistics(HashMap<Object, Object> map);

    //通过注册时间查询用户数
    @Select("select count(*) from user where create_time < #{dateTime};")
    Long userNumberByCreateTime(LocalDateTime dateTime);



}
